﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using RenAi.Medical.Model;

namespace RenAi.Medical.DAL
{
    public class ProblemDAL
    {
        /// <summary>
        /// 显示问题列表
        /// </summary>
        /// <returns></returns>
        public DataTable GetALLProblem()
        {
            string sql = "select * from Problem where Pstate='否'";
            return DBhelper.GetTable(sql);
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="Pid"></param>
        /// <returns></returns>
        public int DelProblem(string Pid)
        {
            string sql = string.Format("delete from Problem where Pid='{0}'",Pid);
            return DBhelper.NonQuery(sql);
        }
        /// <summary>
        /// 修改问题状态
        /// </summary>
        /// <param name="p"></param>
        /// <returns></returns>
        public int UpdProblem(Problem p)
        {
            string sql = string.Format("update Problem set Pstate='{0}' where Pid='{1}'",p.Pstate,p.pid);
            return DBhelper.NonQuery(sql);
        }
    }
}
